package com.ben.chatroom.common;

import lombok.Getter;

/**
 * @author huangyijun
 */
public class ProInstant {


    /**
     * 魔数
     */
    public static final short MAGIC_CODE = 0x56;

    /**
     * 版本
     */
    public static final short VERSION_CODE = 0x01;


    @Getter
    public enum ResultCode {

        SUCCESS(0, "Success"),
        AUTH_FAIL(1, "登录失败"),
        NO_TOKEN(2, "没有授权码"),
        UNKNOWN_ERROR(3, "未知错误");


        private final Integer code;

        private final String desc;

        ResultCode(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public static ResultCode getResult(Integer code) {
            ResultCode value = ResultCode.values()[code];
            return value;
        }

    }
}
